﻿<CustomWindow:EssentialWindow
    x:Class="Pawing.Controls.Emotions.EmotionsBoard"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:CustomWindow="clr-namespace:CustomWindow;assembly=CustomWindow"
        Title="EmotionsBoard" Height="160" Width="300"
  WindowStyle="None"
  ShowInTaskbar="False" ResizeMode="NoResize" Background="{x:Null}" Foreground="{x:Null}" AllowsTransparency="True">
    <Window.Resources>
        <ControlTemplate x:Key="EmotionTabItemTemplate" TargetType="{x:Type TabControl}">
            <Grid ClipToBounds="True" KeyboardNavigation.TabNavigation="Local" SnapsToDevicePixels="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Name="ColumnDefinition0" Width="*"/>
                    <ColumnDefinition Name="ColumnDefinition2" Width="0"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Name="RowDefinition0" Height="Auto"/>
                    <RowDefinition Name="RowDefinition1" Height="*"/>
                </Grid.RowDefinitions>
                <ScrollViewer Name="HeaderScrollViewer" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden">
                    <WrapPanel Name="HeaderPanel" Background="{DynamicResource SecondaryBackgroundBrush}"
                  Margin="2,2,2,0"
                  Panel.ZIndex="1"
                  IsItemsHost="True"
                  KeyboardNavigation.TabIndex="1" MouseMove="HeaderPanel_MouseMove" />
                </ScrollViewer>
                <Border Name="ContentPanel"
                  Grid.Column="0"
                  Grid.Row="1"
                  Background="{TemplateBinding Panel.Background}"
                  BorderBrush="{TemplateBinding Border.BorderBrush}"
                  BorderThickness="{TemplateBinding Border.BorderThickness}"
                  KeyboardNavigation.DirectionalNavigation="Contained"
                  KeyboardNavigation.TabIndex="2"
                  KeyboardNavigation.TabNavigation="Local">
                    <ContentPresenter Name="PART_SelectedContentHost"
                     Margin="{TemplateBinding Control.Padding}"
                     Content="{TemplateBinding TabControl.SelectedContent}"
                     ContentSource="SelectedContent"
                     ContentStringFormat="{TemplateBinding TabControl.SelectedContentStringFormat}"
                     ContentTemplate="{TemplateBinding TabControl.SelectedContentTemplate}"
                     SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
                </Border>
            </Grid>
        </ControlTemplate>
    </Window.Resources>
    <Grid MouseEnter="Grid_MouseEnter" MouseLeave="Grid_MouseLeave">
        <Border  Height="160" Width="300" BorderThickness="16" CornerRadius="5" MouseDown="Border_MouseDown" BorderBrush="#9957C6EF">
            <TabControl Margin="-2,-2,-2,0" x:Name="Tabs" Template="{StaticResource EmotionTabItemTemplate}" Background="{DynamicResource UpdateBackgroundBrush}">
                <TabControl.Resources>
                    <Style TargetType="{x:Type TabItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type TabItem}">
                                    <Grid>
                                        <Border x:Name="Border" Background="{DynamicResource SecondaryBackgroundBrush}" BorderThickness="1,1,1,0" BorderBrush="{StaticResource NormalBorderBrush}">
                                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" />
                                        </Border>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" TargetName="Border" Value="{DynamicResource DarkBrush}" />
                                        </Trigger>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="Panel.ZIndex" Value="100" />
                                            <Setter Property="Background" TargetName="Border" Value="#FF5C869D" />
                                            <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource ImageBorderBrush}" />
                                        </Trigger>
                                        <Trigger Property="IsEnabled" Value="False">
                                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </TabControl.Resources>
            </TabControl>
        </Border>
        <Border x:Name="WindowButtonsPlaceholder" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,16,0" />
    </Grid>
</CustomWindow:EssentialWindow>
